<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*
<span class='line'>  2</span>  * vim:set spell spl=en fo=wan1croqlt tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix:
<span class='line'>  3</span>  *
<span class='line'>  4</span>  * Copyright (C) 2008, 2009 Mihai Şucan
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * This file is part of libmacrame.
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * Libmacrame is free software: you can redistribute it and/or modify
<span class='line'>  9</span>  * it under the terms of the GNU General Public License as published by
<span class='line'> 10</span>  * the Free Software Foundation, either version 3 of the License, or
<span class='line'> 11</span>  * (at your option) any later version.
<span class='line'> 12</span>  *
<span class='line'> 13</span>  * Libmacrame is distributed in the hope that it will be useful,
<span class='line'> 14</span>  * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class='line'> 15</span>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class='line'> 16</span>  * GNU General Public License for more details.
<span class='line'> 17</span>  *
<span class='line'> 18</span>  * You should have received a copy of the GNU General Public License
<span class='line'> 19</span>  * along with Libmacrame.  If not, see &lt;http://www.gnu.org/licenses/>.
<span class='line'> 20</span>  *
<span class='line'> 21</span>  * $URL: http://code.google.com/p/libmacrame $
<span class='line'> 22</span>  * $Date: 2009-04-17 19:06:03 +0300 $
<span class='line'> 23</span>  *
<span class='line'> 24</span>  */</span><span class="WHIT">
<span class='line'> 25</span> 
<span class='line'> 26</span> </span><span class="COMM">/**
<span class='line'> 27</span>  * @author &lt;a lang="ro" href="http://www.robodesign.ro/mihai">Mihai Şucan&lt;/a>
<span class='line'> 28</span>  * @version Pre-alpha release. In-design phase, unstable API.
<span class='line'> 29</span>  * @fileOverview The libmacrame core code.
<span class='line'> 30</span>  */</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> 
<span class='line'> 33</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 34</span> 
<span class='line'> 35</span> </span><span class="COMM">/*
<span class='line'> 36</span>  * This defines the global alias to use for the libmacrame object. Set this to 
<span class='line'> 37</span>  * false if you don't want any global object.
<span class='line'> 38</span>  */</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_alias</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'$'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 40</span> 
<span class='line'> 41</span> </span><span class="COMM">/**
<span class='line'> 42</span>  * The global libmacrame object which can't be changed, and which must be used 
<span class='line'> 43</span>  * by any plugins extending the functionality of the library.
<span class='line'> 44</span>  *
<span class='line'> 45</span>  * @function
<span class='line'> 46</span>  * @name libmacrame
<span class='line'> 47</span>  * @see $ By default, the entire libmacrame object is aliased by $, for quicker 
<span class='line'> 48</span>  * access.
<span class='line'> 49</span>  * @see $.init The function being called, when you call libmacrame().
<span class='line'> 50</span>  *
<span class='line'> 51</span>  * @param {String} selector
<span class='line'> 52</span>  * @param {Document|Element} [context=document]
<span class='line'> 53</span>  */</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">libmacrame</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">$.init</span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 57</span> 
<span class='line'> 58</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_alias</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT">  </span><span class="NAME">window</span><span class="PUNC">[</span><span class="NAME">_alias</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">libmacrame</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 61</span> 
<span class='line'> 62</span> </span><span class="NAME">window.libmacrame</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">libmacrame</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> 
<span class='line'> 64</span> </span><span class="COMM">/**
<span class='line'> 65</span>  * The $ symbol is simply an alias of {@link libmacrame}, for quicker access to 
<span class='line'> 66</span>  * the main namespace and main function, which is {@link $.init}.
<span class='line'> 67</span>  *
<span class='line'> 68</span>  * @class The libmacrame namespace.
<span class='line'> 69</span>  * @name $
<span class='line'> 70</span>  * @see libmacrame
<span class='line'> 71</span>  * @see $.init This is the function called when you call $()
<span class='line'> 72</span>  *
<span class='line'> 73</span>  * @param {String} selector
<span class='line'> 74</span>  * @param {Document|Element} [context=document]
<span class='line'> 75</span>  */</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">$</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">libmacrame</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 77</span> 
<span class='line'> 78</span> </span><span class="COMM">/*
<span class='line'> 79</span>  * This regular expression used to quickly match ID and class name CSS 
<span class='line'> 80</span>  * selectors.
<span class='line'> 81</span>  */</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">re_id_class</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/^(#|\.)?([a-zA-Z][a-zA-Z\d_-]*)$/</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> 
<span class='line'> 84</span> </span><span class="COMM">/**
<span class='line'> 85</span>  * Find DOM elements.
<span class='line'> 86</span>  * 
<span class='line'> 87</span>  * &lt;p>This function currently allows you to use CSS selectors to find the DOM 
<span class='line'> 88</span>  * elements you want.
<span class='line'> 89</span>  *
<span class='line'> 90</span>  * &lt;p>TODO: This is not done yet.
<span class='line'> 91</span>  *
<span class='line'> 92</span>  * @requires A Web browser which implements &lt;a 
<span class='line'> 93</span>  * href="http://www.w3.org/TR/selectors-api/">Selectors API&lt;/a>. Currently this 
<span class='line'> 94</span>  * means &lt;a href="http://opera.com">Opera&lt;/a> 10+, &lt;a 
<span class='line'> 95</span>  * href="http://mozilla.com">Firefox&lt;/a> 3.1+ and &lt;a 
<span class='line'> 96</span>  * href="http://apple.com/safari">Safari&lt;/a> 4+.
<span class='line'> 97</span>  *
<span class='line'> 98</span>  * @example
<span class='line'> 99</span>  * // Find the element with id='foo':
<span class='line'>100</span>  *
<span class='line'>101</span>  * &lt;code>$('#foo');&lt;/code>
<span class='line'>102</span>  *
<span class='line'>103</span>  * @example
<span class='line'>104</span>  * // Find the elements having a class token 'foo':
<span class='line'>105</span>  *
<span class='line'>106</span>  * &lt;code>$('.foo');&lt;/code>
<span class='line'>107</span>  *
<span class='line'>108</span>  * @example
<span class='line'>109</span>  * // Find all the &lt;code>&lt;span&gt;&lt;/code> elements which are direct child
<span class='line'>110</span>  * // children of &lt;code>&lt;p&gt;&lt;/code> elements:
<span class='line'>111</span>  *
<span class='line'>112</span>  * &lt;code>$('p &gt; span');&lt;/code>
<span class='line'>113</span>  *
<span class='line'>114</span>  * @param {String} selector The CSS selector. You can also use multiple 
<span class='line'>115</span>  * selectors, separated by comma. Basically, you can use anything supported by 
<span class='line'>116</span>  * querySelectorAll().
<span class='line'>117</span>  *
<span class='line'>118</span>  * @param {Document|Element} [context=document] The context where the CSS 
<span class='line'>119</span>  * selector will be used for finding the matching elements.
<span class='line'>120</span>  *
<span class='line'>121</span>  * @returns {Element|NodeList} The element found, or the list of elements 
<span class='line'>122</span>  * matching the selector.
<span class='line'>123</span>  */</span><span class="WHIT">
<span class='line'>124</span> </span><span class="NAME">$.init</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">selector</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">selector</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">selector</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>128</span> 
<span class='line'>129</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">    </span><span class="NAME">context</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>132</span> 
<span class='line'>133</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">      </span><span class="NAME">match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">re_id_class.exec</span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> 
<span class='line'>136</span> </span><span class="WHIT">  </span><span class="COMM">// If the selector is not an ID/class name, then just use the query selector.</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">match</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">context.querySelectorAll</span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>140</span> 
<span class='line'>141</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'#'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">    </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.getElementById</span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT">    </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.getElementsByClassName</span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT">    </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.getElementsByTagName</span><span class="PUNC">(</span><span class="NAME">match</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT">    </span><span class="NAME">elem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.querySelectorAll</span><span class="PUNC">(</span><span class="NAME">selector</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>150</span> 
<span class='line'>151</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">elem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> 
<span class='line'>154</span> </span><span class="COMM">/**
<span class='line'>155</span>  * @namespace Holds browser information.
<span class='line'>156</span>  */</span><span class="WHIT">
<span class='line'>157</span> </span><span class="NAME">$.browser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>158</span> 
<span class='line'>159</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ua</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>160</span> 
<span class='line'>161</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.navigator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">window.navigator.userAgent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT">  </span><span class="NAME">ua</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.navigator.userAgent.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>163</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>164</span> 
<span class='line'>165</span> </span><span class="COMM">/**
<span class='line'>166</span>  * Determine the browser version.
<span class='line'>167</span>  *
<span class='line'>168</span>  * @param {String} name The browser name you want to search for, in the User 
<span class='line'>169</span>  * Agent string. The string is not escaped, thus you must use regular expression 
<span class='line'>170</span>  * syntax.
<span class='line'>171</span>  *
<span class='line'>172</span>  * @param {Number} [pos=1] The index of the matching parenthesis in the regular 
<span class='line'>173</span>  * expressiong. The value of the index will be returned by this function 
<span class='line'>174</span>  * (ua.match(regex)).
<span class='line'>175</span>  *
<span class='line'>176</span>  * @returns {String|null} The matching version number.
<span class='line'>177</span>  */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="NAME">b.findVer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">regex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'\\b'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'[\\/: ]([0-9a-z.+-]+)'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">res</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ua.match</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="NAME">regex</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">pos</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">    </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>184</span> 
<span class='line'>185</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">res</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">res</span><span class="PUNC">[</span><span class="NAME">pos</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> 
<span class='line'>188</span> </span><span class="COMM">/**
<span class='line'>189</span>  * @name $.browser.opera
<span class='line'>190</span>  * @type Boolean
<span class='line'>191</span>  */</span><span class="WHIT">
<span class='line'>192</span> </span><span class="NAME">b.opera</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.opera</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="REGX">/\bopera\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> 
<span class='line'>194</span> </span><span class="COMM">/**
<span class='line'>195</span>  * @name $.browser.operaVersion
<span class='line'>196</span>  */</span><span class="WHIT">
<span class='line'>197</span> </span><span class="NAME">b.operaVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>198</span> 
<span class='line'>199</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.opera</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">window.opera.version</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">  </span><span class="NAME">b.operaVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">window.opera.version</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> 
<span class='line'>201</span>     </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">window.opera.version</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.opera.version</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b.opera</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">  </span><span class="NAME">b.operaVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'opera'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>205</span> 
<span class='line'>206</span> </span><span class="COMM">/**
<span class='line'>207</span>  * Webkit is the render engine used primarily by Safari. It's also used by 
<span class='line'>208</span>  * Google Chrome and GNOME Epiphany.
<span class='line'>209</span>  *
<span class='line'>210</span>  * @name $.browser.webkit
<span class='line'>211</span>  * @type Boolean
<span class='line'>212</span>  */</span><span class="WHIT">
<span class='line'>213</span> </span><span class="NAME">b.webkit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\b(applewebkit|webkit)\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> 
<span class='line'>215</span> </span><span class="COMM">/**
<span class='line'>216</span>  * @name $.browser.webkitVersion
<span class='line'>217</span>  */</span><span class="WHIT">
<span class='line'>218</span> </span><span class="NAME">b.webkitVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.webkit</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'(applewebkit|webkit)'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> 
<span class='line'>220</span> </span><span class="COMM">/**
<span class='line'>221</span>  * Epiphany is the default Web browser of the GNOME desktop environment.
<span class='line'>222</span>  *
<span class='line'>223</span>  * @name $.browser.epiphany
<span class='line'>224</span>  * @type Boolean
<span class='line'>225</span>  */</span><span class="WHIT">
<span class='line'>226</span> </span><span class="NAME">b.epiphany</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bepiphany\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>227</span> 
<span class='line'>228</span> </span><span class="COMM">/**
<span class='line'>229</span>  * @name $.browser.epiphanyVersion
<span class='line'>230</span>  */</span><span class="WHIT">
<span class='line'>231</span> </span><span class="NAME">b.epiphanyVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.epiphany</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'epiphany'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> 
<span class='line'>233</span> </span><span class="COMM">/**
<span class='line'>234</span>  * Firefox uses the Gecko render engine.
<span class='line'>235</span>  *
<span class='line'>236</span>  *
<span class='line'>237</span>  * @name $.browser.firefox
<span class='line'>238</span>  * @type Boolean
<span class='line'>239</span>  */</span><span class="WHIT">
<span class='line'>240</span> </span><span class="COMM">// In some variations of the User Agent strings provided by Epiphany and Opera, </span><span class="WHIT">
<span class='line'>241</span> </span><span class="COMM">// Firefox is mentioned.</span><span class="WHIT">
<span class='line'>242</span> </span><span class="NAME">b.firefox</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bfirefox\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.opera</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.epiphany</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> 
<span class='line'>244</span> </span><span class="COMM">/**
<span class='line'>245</span>  * @name $.browser.firefoxVersion
<span class='line'>246</span>  */</span><span class="WHIT">
<span class='line'>247</span> </span><span class="NAME">b.firefoxVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.firefox</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'firefox'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> 
<span class='line'>249</span> </span><span class="COMM">/**
<span class='line'>250</span>  * Gecko is the render engine used by Firefox and related products.
<span class='line'>251</span>  *
<span class='line'>252</span>  * @name $.browser.gecko
<span class='line'>253</span>  * @type Boolean
<span class='line'>254</span>  */</span><span class="WHIT">
<span class='line'>255</span> </span><span class="COMM">// Typically, the user agent string of WebKit also mentions Gecko. Additionally, </span><span class="WHIT">
<span class='line'>256</span> </span><span class="COMM">// Opera mentions Gecko for tricking some sites.</span><span class="WHIT">
<span class='line'>257</span> </span><span class="NAME">b.gecko</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bgecko\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.opera</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.webkit</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="COMM">// TODO: b.geckoRevision</span><span class="WHIT">
<span class='line'>259</span> 
<span class='line'>260</span> </span><span class="COMM">/**
<span class='line'>261</span>  * @name $.browser.geckoBuild
<span class='line'>262</span>  */</span><span class="WHIT">
<span class='line'>263</span> </span><span class="NAME">b.geckoBuild</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.gecko</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'gecko'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> 
<span class='line'>265</span> </span><span class="COMM">/**
<span class='line'>266</span>  * KHTML is the render engine used by Konqueror.
<span class='line'>267</span>  *
<span class='line'>268</span>  * @name $.browser.khtml
<span class='line'>269</span>  * @type Boolean
<span class='line'>270</span>  */</span><span class="WHIT">
<span class='line'>271</span> </span><span class="COMM">// Epiphany does mention KHTML...</span><span class="WHIT">
<span class='line'>272</span> </span><span class="NAME">b.khtml</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bkhtml\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.epiphany</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> 
<span class='line'>274</span> </span><span class="COMM">/**
<span class='line'>275</span>  * @name $.browser.khtmlVersion
<span class='line'>276</span>  */</span><span class="WHIT">
<span class='line'>277</span> </span><span class="NAME">b.khtmlVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.khtml</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'khtml'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span> 
<span class='line'>279</span> </span><span class="COMM">/**
<span class='line'>280</span>  * Konqueror is the Web browser of the KDE desktop environment.
<span class='line'>281</span>  *
<span class='line'>282</span>  * @name $.browser.konqueror
<span class='line'>283</span>  * @type Boolean
<span class='line'>284</span>  */</span><span class="WHIT">
<span class='line'>285</span> </span><span class="NAME">b.konqueror</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bkonqueror\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> 
<span class='line'>287</span> </span><span class="COMM">/**
<span class='line'>288</span>  * @name $.browser.konquerorVersion
<span class='line'>289</span>  */</span><span class="WHIT">
<span class='line'>290</span> </span><span class="NAME">b.konquerorVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.konqueror</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'konqueror'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> 
<span class='line'>292</span> </span><span class="COMM">/**
<span class='line'>293</span>  * Google Chrome uses WebKit as the render engine.
<span class='line'>294</span>  *
<span class='line'>295</span>  * @name $.browser.chrome
<span class='line'>296</span>  * @type Boolean
<span class='line'>297</span>  */</span><span class="WHIT">
<span class='line'>298</span> </span><span class="NAME">b.chrome</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bchrome\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> 
<span class='line'>300</span> </span><span class="COMM">/**
<span class='line'>301</span>  * @name $.browser.chromeVersion
<span class='line'>302</span>  */</span><span class="WHIT">
<span class='line'>303</span> </span><span class="NAME">b.chromeVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.chrome</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'chrome'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>304</span> 
<span class='line'>305</span> </span><span class="COMM">/**
<span class='line'>306</span>  * Microsoft Internet Explorer. The future of computing.
<span class='line'>307</span>  *
<span class='line'>308</span>  * @name $.browser.msie
<span class='line'>309</span>  * @type Boolean
<span class='line'>310</span>  */</span><span class="WHIT">
<span class='line'>311</span> </span><span class="COMM">// Again, Opera allows users to easily fake the UA.</span><span class="WHIT">
<span class='line'>312</span> </span><span class="NAME">b.msie</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bmsie\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.opera</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>313</span> 
<span class='line'>314</span> </span><span class="COMM">/**
<span class='line'>315</span>  * @name $.browser.msieVersion
<span class='line'>316</span>  */</span><span class="WHIT">
<span class='line'>317</span> </span><span class="NAME">b.msieVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.msie</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'msie'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> 
<span class='line'>319</span> </span><span class="COMM">/**
<span class='line'>320</span>  * Presto is the render engine used by Opera.
<span class='line'>321</span>  *
<span class='line'>322</span>  * @name $.browser.presto
<span class='line'>323</span>  * @type Boolean
<span class='line'>324</span>  */</span><span class="WHIT">
<span class='line'>325</span> </span><span class="COMM">// Older versions of Opera did not mention Presto in the UA string.</span><span class="WHIT">
<span class='line'>326</span> </span><span class="NAME">b.presto</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bpresto\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b.opera</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> 
<span class='line'>328</span> </span><span class="COMM">/**
<span class='line'>329</span>  * @name $.browser.prestoVersion
<span class='line'>330</span>  */</span><span class="WHIT">
<span class='line'>331</span> </span><span class="NAME">b.prestoVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.presto</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'presto'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> 
<span class='line'>333</span> </span><span class="COMM">/**
<span class='line'>334</span>  * @name $.browser.mozilla
<span class='line'>335</span>  * @type Boolean
<span class='line'>336</span>  */</span><span class="WHIT">
<span class='line'>337</span> </span><span class="COMM">// Everyone mentions Mozilla. Hehe.</span><span class="WHIT">
<span class='line'>338</span> </span><span class="NAME">b.mozilla</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bmozilla\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.opera</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.webkit</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.presto</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>339</span> 
<span class='line'>340</span> </span><span class="COMM">/**
<span class='line'>341</span>  * Safari is the default Web browser of Mac OS, from Apple. It uses the WebKit 
<span class='line'>342</span>  * render engine.
<span class='line'>343</span>  *
<span class='line'>344</span>  * @name $.browser.safari
<span class='line'>345</span>  * @type Boolean
<span class='line'>346</span>  */</span><span class="WHIT">
<span class='line'>347</span> </span><span class="COMM">// Google Chrome mentions Safari and Epiphany does this as well.</span><span class="WHIT">
<span class='line'>348</span> </span><span class="NAME">b.safari</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="REGX">/\bsafari\b/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">ua</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b.webkit</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.epiphany</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">b.chrome</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>349</span> 
<span class='line'>350</span> </span><span class="COMM">/**
<span class='line'>351</span>  * @name $.browser.safariVersion
<span class='line'>352</span>  */</span><span class="WHIT">
<span class='line'>353</span> </span><span class="NAME">b.safariVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.safari</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">(</span><span class="STRN">'safari'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> 
<span class='line'>355</span> 
<span class='line'>356</span> </span><span class="COMM">/**
<span class='line'>357</span>  * The browser name. If the browser is unrecognized, it will contain the browser 
<span class='line'>358</span>  * engine name. If all fails, the property will be null.
<span class='line'>359</span>  *
<span class='line'>360</span>  * @name $.browser.name
<span class='line'>361</span>  * @type String
<span class='line'>362</span>  */</span><span class="WHIT">
<span class='line'>363</span> </span><span class="COMM">// Here the order is important: start with the browsers, and end with the engine </span><span class="WHIT">
<span class='line'>364</span> </span><span class="COMM">// names.</span><span class="WHIT">
<span class='line'>365</span> </span><span class="NAME">b.name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b.epiphany</span><span class="WHIT">  </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'epiphany'</span><span class="WHIT">  </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT">         </span><span class="NAME">b.firefox</span><span class="WHIT">   </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'firefox'</span><span class="WHIT">   </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT">         </span><span class="NAME">b.konqueror</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'konqueror'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT">         </span><span class="NAME">b.opera</span><span class="WHIT">     </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'opera'</span><span class="WHIT">     </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT">         </span><span class="NAME">b.msie</span><span class="WHIT">      </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'msie'</span><span class="WHIT">      </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">         </span><span class="NAME">b.chrome</span><span class="WHIT">    </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'chrome'</span><span class="WHIT">    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">         </span><span class="NAME">b.safari</span><span class="WHIT">    </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'safari'</span><span class="WHIT">    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">         </span><span class="NAME">b.presto</span><span class="WHIT">    </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'presto'</span><span class="WHIT">    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">         </span><span class="NAME">b.khtml</span><span class="WHIT">     </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'khtml'</span><span class="WHIT">     </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT">         </span><span class="NAME">b.webkit</span><span class="WHIT">    </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'webkit'</span><span class="WHIT">    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">         </span><span class="NAME">b.gecko</span><span class="WHIT">     </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'gecko'</span><span class="WHIT">     </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">         </span><span class="NAME">b.mozilla</span><span class="WHIT">   </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'mozilla'</span><span class="WHIT">   </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>377</span> 
<span class='line'>378</span> </span><span class="COMM">/**
<span class='line'>379</span>  * The version of the browser or render engine.
<span class='line'>380</span>  *
<span class='line'>381</span>  * @name $.browser.version
<span class='line'>382</span>  * @type String
<span class='line'>383</span>  */</span><span class="WHIT">
<span class='line'>384</span> </span><span class="NAME">b.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">b.name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'Version'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>385</span> 
<span class='line'>386</span> </span><span class="COMM">/**
<span class='line'>387</span>  * Browser operating system
<span class='line'>388</span>  *
<span class='line'>389</span>  * @name $.browser.os
<span class='line'>390</span>  * @type String
<span class='line'>391</span>  */</span><span class="WHIT">
<span class='line'>392</span> </span><span class="NAME">b.os</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ua.match</span><span class="PUNC">(</span><span class="REGX">/\b(windows|linux)\b/</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>393</span> 
<span class='line'>394</span> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">b.findVer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>395</span> 
<span class='line'>396</span> </span><span class="NAME">$.browser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> 
<span class='line'>398</span> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ua</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> 
<span class='line'>400</span> </span><span class="COMM">/**
<span class='line'>401</span>  * This function extends objects.
<span class='line'>402</span>  *
<span class='line'>403</span>  * @example
<span class='line'>404</span>  * &lt;code>var &lt;var>obj1&lt;/var> = {a: 'a1', b: 'b1', d: 'd1'},
<span class='line'>405</span>  *     &lt;var>obj2&lt;/var> = {a: 'a2', b: 'b2', c: 'c2'};
<span class='line'>406</span>  * 
<span class='line'>407</span>  * $.extend(&lt;var>obj1&lt;/var>, &lt;var>obj2&lt;/var>);&lt;/code>
<span class='line'>408</span>  * 
<span class='line'>409</span>  * // Now &lt;var>obj1.c == 'c2'&lt;/var>, while &lt;var>obj1.a&lt;/var>, &lt;var>obj1.b&lt;/var>
<span class='line'>410</span>  * // and &lt;var>obj1.d&lt;/var> remain the same.
<span class='line'>411</span>  *
<span class='line'>412</span>  * // If &lt;code>$.extend(true, &lt;var>obj1&lt;/var>, &lt;var>obj2&lt;/var>)&lt;/code> is
<span class='line'>413</span>  * // called, then &lt;var>obj1.a&lt;/var>, &lt;var>obj1.b&lt;/var>, &lt;var>obj1.c&lt;/var>
<span class='line'>414</span>  * // become all the same as in &lt;var>obj2&lt;/var>.
<span class='line'>415</span>  *
<span class='line'>416</span>  * @example
<span class='line'>417</span>  * &lt;code>var &lt;var>obj1&lt;/var> = {a: 'a1', b: 'b1', extend: $.extend};
<span class='line'>418</span>  * &lt;var>obj1&lt;/var>.extend({c: 'c1', d: 'd1'});&lt;/code>
<span class='line'>419</span>  *
<span class='line'>420</span>  * // In this case the destination object which is to be extend is
<span class='line'>421</span>  * // &lt;var>obj1&lt;/var>.
<span class='line'>422</span>  *
<span class='line'>423</span>  * @param {Boolean} [overwrite=false] If the first argument is a boolean, then 
<span class='line'>424</span>  * it will be considered as a boolean flag for overwriting (or not) any existing 
<span class='line'>425</span>  * methods and properties in the destination object. Thus, any method and 
<span class='line'>426</span>  * property from the source object will take over those in the destination. The 
<span class='line'>427</span>  * argument is optional, and if it's omitted, then no method/property will be 
<span class='line'>428</span>  * overwritten.
<span class='line'>429</span>  *
<span class='line'>430</span>  * @param {Object} [destination=this] The second argument is the optional 
<span class='line'>431</span>  * destination object: the object which will be extended. By default, the 
<span class='line'>432</span>  * &lt;var>this&lt;/var> object will be extended.
<span class='line'>433</span>  *
<span class='line'>434</span>  * @param {Object} source The third argument must provide list of methods and 
<span class='line'>435</span>  * properties which will be added to the destination object.
<span class='line'>436</span>  */</span><span class="WHIT">
<span class='line'>437</span> </span><span class="NAME">$.extend</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">extend</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">      </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments.length</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">      </span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">src</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sval</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dval</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>441</span> 
<span class='line'>442</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'boolean'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">    </span><span class="NAME">force</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">    </span><span class="NAME">dest</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">    </span><span class="NAME">src</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">    </span><span class="NAME">force</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">    </span><span class="NAME">dest</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT">    </span><span class="NAME">src</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>451</span> 
<span class='line'>452</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">src</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">    </span><span class="NAME">src</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dest</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">    </span><span class="NAME">dest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>456</span> 
<span class='line'>457</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">dest</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>460</span> 
<span class='line'>461</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">src</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">    </span><span class="NAME">sval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">src</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">    </span><span class="NAME">dval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dest</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">force</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">dval</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">      </span><span class="NAME">dest</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sval</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>468</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> 
<span class='line'>470</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span> 
<span class='line'>472</span> </span></pre></body></html>